/*
 * @Author: yangzonglong
 * @Date: 2020-08-13 16:21:06
 * @version: v1.0.0
 * @Descripttion: 路由携带query，当返回时会导致query的丢失，此模块缓存路由对应的完整的地址信息 path + search
 * @LastEditors: yangzonglong
 * @LastEditTime: 2021-02-19 09:47:21
 * @Auditor: 
 */

const SESSION_KEY = '_footprint';
const map = sessionStorage[SESSION_KEY] ? JSON.parse(sessionStorage[SESSION_KEY]) : {};

export function setRouteHistory(path: string, wholePath: string){
  map[path] = wholePath;
  sessionStorage.setItem(SESSION_KEY, JSON.stringify(map));
}

export function getRouteHistory(path: string){
  return map[path] || path
}
